Namespace Kardex
Public Class OrdenCompra
	Inherits Auditoria.Transaccion

	Private vOrdenCompraId As Integer = -1
	Private vProveedorId As Integer = -1
	Private vProveedorNombre As string =""
	Private vTipoDocumento As Integer = -1
	Private vNumeroDocumento As String = ""
	Private vAlmacenId As Integer = -1
	Private vAlmacenNombre As string =""
	Private vFecha As Long = 0
	Private vSubTotal As Double = 0.0
	Private vIGV_PORCENTAJE As Double = 0.0
	Private vIGV As Double = 0.0
	Private vTotal As Double = 0.0
	Private vDescripcion As String = ""

	Public Property OrdenCompraId() As Integer
		Get
			Return vOrdenCompraId
		End Get
		Set(ByVal Value As Integer)
			vOrdenCompraId = Value
		End Set
	End Property

	Public Property ProveedorId() As Integer
		Get
			Return vProveedorId
		End Get
		Set(ByVal Value As Integer)
			vProveedorId = Value
		End Set
	End Property

	Public Property ProveedorNombre() as string
		Get
			Return vProveedorNombre
		End Get
		Set(ByVal Value As string)
			vProveedorNombre = Value
		End Set
	End Property

	Public Property TipoDocumento() As Integer
		Get
			Return vTipoDocumento
		End Get
		Set(ByVal Value As Integer)
			vTipoDocumento = Value
		End Set
	End Property

	Public Property NumeroDocumento() As String
		Get
			Return vNumeroDocumento
		End Get
		Set(ByVal Value As String)
			vNumeroDocumento = Value
		End Set
	End Property

	Public Property AlmacenId() As Integer
		Get
			Return vAlmacenId
		End Get
		Set(ByVal Value As Integer)
			vAlmacenId = Value
		End Set
	End Property

	Public Property AlmacenNombre() as string
		Get
			Return vAlmacenNombre
		End Get
		Set(ByVal Value As string)
			vAlmacenNombre = Value
		End Set
	End Property

	Public Property Fecha() As Long
		Get
			Return vFecha
		End Get
		Set(ByVal Value As Long)
			vFecha = Value
		End Set
	End Property

	Public readonly  Property FechaStr() as string
		Get
			Return System.DateTime.FromFileTime(Fecha).ToShortDateString
		End Get
	End Property

	Public Property SubTotal() As Double
		Get
			Return vSubTotal
		End Get
		Set(ByVal Value As Double)
			vSubTotal = Value
		End Set
	End Property

	Public Property IGV_PORCENTAJE() As Double
		Get
			Return vIGV_PORCENTAJE
		End Get
		Set(ByVal Value As Double)
			vIGV_PORCENTAJE = Value
		End Set
	End Property

	Public Property IGV() As Double
		Get
			Return vIGV
		End Get
		Set(ByVal Value As Double)
			vIGV = Value
		End Set
	End Property

	Public Property Total() As Double
		Get
			Return vTotal
		End Get
		Set(ByVal Value As Double)
			vTotal = Value
		End Set
	End Property

	Public Property Descripcion() As String
		Get
			Return vDescripcion
		End Get
		Set(ByVal Value As String)
			vDescripcion = Value
		End Set
	End Property

	Sub New()
	End Sub

	Sub New(ByRef OrdenCompraId As Integer, ByVal ProveedorId As Integer, ByVal TipoDocumento As Integer, ByVal NumeroDocumento As String, ByVal AlmacenId As Integer, ByVal Fecha As Long, ByVal SubTotal As Double, ByVal IGV_PORCENTAJE As Double, ByVal IGV As Double, ByVal Total As Double, ByVal Descripcion As String)
		vOrdenCompraId = OrdenCompraId
		vProveedorId = ProveedorId
		vTipoDocumento = TipoDocumento
		vNumeroDocumento = NumeroDocumento
		vAlmacenId = AlmacenId
		vFecha = Fecha
		vSubTotal = SubTotal
		vIGV_PORCENTAJE = IGV_PORCENTAJE
		vIGV = IGV
		vTotal = Total
		vDescripcion = Descripcion
	End Sub

End Class



 Public Class OrdenCompraCol   
 Inherits System.Collections.CollectionBase
Private _enmSortDirection As SortDirection
Public Sub New()
_enmSortDirection = SortDirection.Asc
End Sub
Public Sub Sort(ByVal sortExpression As String, ByVal sortDirection As SortDirection)
InnerList.Sort(New Comparer(sortExpression, SortDirection))
End Sub
Public Sub Sort(ByVal sortExpression As String)
InnerList.Sort(New Comparer(sortExpression, _enmSortDirection))
If _enmSortDirection = SortDirection.Asc Then
_enmSortDirection = SortDirection.Desc
Else
_enmSortDirection = SortDirection.Asc
End If
End Sub
Public Function Add(ByVal obj As OrdenCompra) As Integer
Return MyBase.List.Add(obj)
End Function
Public Sub AddPrimero(ByVal obj As OrdenCompra)
MyBase.List.Insert(0, obj)
End Sub
Public ReadOnly Property OrdenCompra(ByVal Index As Integer) As OrdenCompra
Get
Return CType(MyBase.List(Index), OrdenCompra)
End Get
End Property
End Class
end namespace

